import java.util.ArrayList;
import java.util.Collections;

public class 发牌 {
    public static void main(String[] args) {
        ArrayList huaselist = new ArrayList();
        ArrayList shuzhilist = new ArrayList<>();
        ArrayList pokerlist = new ArrayList();
        ArrayList alllist = new ArrayList();
        ArrayList one = new ArrayList();
        ArrayList two = new ArrayList();
        ArrayList three = new ArrayList();
        ArrayList dipai = new ArrayList();

        //定义花色
        huaselist.add("♥️️");
        huaselist.add("♦️");
        huaselist.add("♠️");
        huaselist.add("♣️");

        //定义数字
        shuzhilist.add("A");
        shuzhilist.add("K");
        shuzhilist.add("Q");
        shuzhilist.add("J");
        for (int i = 2; i < 11; i++) {
            shuzhilist.add(i);
        }
        //定义大小王
        pokerlist.add("大王");
        pokerlist.add("小王");
        //嵌套for循环，组装牌面
        for (int i = 0; i < huaselist.size(); i++) {
            for (int i1 = 0; i1 < shuzhilist.size(); i1++) {
                alllist.add(huaselist.get(i) +""+ shuzhilist.get(i1));
            }
        }

        //把大小王添加进排面
        alllist.add(pokerlist.get(0));
        alllist.add(pokerlist.get(1));

        //洗牌
        Collections.shuffle(alllist);

        //存入三张底牌
        dipai.add(alllist.get(0));
        dipai.add(alllist.get(1));
        dipai.add(alllist.get(2));

        //for循环发牌
        for (int count = 3; count < alllist.size(); count++) {
            if (count % 3 == 0) {
                one.add(alllist.get(count));
            } else if (count % 3 == 1) {
                two.add(alllist.get(count));
            } else if (count % 3 == 2) {
                three.add(alllist.get(count));
            }
        }

        //输出各玩家牌面
        System.out.println("玩家A的牌是：" + one);
        System.out.println("玩家B的牌是：" + two);
        System.out.println("玩家C的牌是：" + three);
        System.out.println("底牌是：" + dipai);
        //System.out.println(one.size());
        //System.out.println(two.size());
        //System.out.println(three.size());
    }


}
